import { IsEnum, IsNotEmpty, IsOptional, MaxLength } from 'class-validator'
import i18n, { i18nMessage } from '@/i18n'
import { DomainModel } from '@apps/meta/domain/model'
import { ApiProperty } from '@nestjs/swagger'

export class MetaResourceModuleActionListDto {
  @ApiProperty({ description: i18n.t('app-meta.dto.meta-resource-module-action-list.12150127-0') })
  @IsNotEmpty()
  @MaxLength(64, { message: i18nMessage() })
  platform: string

  @ApiProperty({ description: i18n.t('app-meta.dto.meta-resource-module-action-list.12150127-1') })
  @MaxLength(64, { message: i18nMessage() })
  resourceModuleName: string

  @ApiProperty({ description: i18n.t('app-meta.dto.meta-resource-module-action-list.12150127-2') })
  @MaxLength(64, { message: i18nMessage() })
  @IsOptional()
  label?: string

  @ApiProperty({
    description: i18n.t('app-meta.dto.meta-resource-module-action-list.12150127-3'),
    enum: DomainModel.ApiPropertyEnum.MetaResourceModuleActionType,
    isArray: true,
  })
  @IsEnum(DomainModel.MetaResourceModuleActionType, { each: true })
  actionTypes?: DomainModel.MetaResourceModuleActionType[]
}
